<?php

if (!defined('MODULES_DIR')) {
    define('MODULES_DIR', dirname(__FILE__).DIR_SEP);
}

require_once(MODULES_DIR.'db.inc');

class BlogRoll
{
	protected $db;
	public $id;
	public $title;
	public $content;
	public $url;
	

	function __construct()
	{
		$this->db = DB::getInstance()->getDB();
	}

	static function getAll()
	{
		return DB::getInstance()->query("select id, title, content, url, paragraph,
			CASE open_window WHEN false THEN 0 WHEN true THEN 1 END as open_window ,
			CASE allow_follow WHEN false THEN 0 WHEN true THEN 1 END as allow_follow from t_blog_roll");	
	}

}

?>